<?php
// april 10, 2008

class tag extends Model {

	public $table = 'tags';
	
	
	public function getContent($page)
	{
		$query = new Query("SELECT `content` FROM `content_tag_relations` WHERE `tag` = ? ORDER BY `id` DESC LIMIT ?, 5", $this->id, $page);
		
		$this->content = blog::recordSet($query, 'blog');
		
	}
	
	public function tagExists($tag)
	{
		$query = new Query("SELECT * FROM `tags` WHERE `tag` = ? ORDER BY `id`", $tag);
		
		if($query->num_rows() > 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

}
?>